import time

class Timekeeper(object):
   frame_time = 0.0
   last_updated = 0.0
   
   def frame(self):
      return Timekeeper.frame_time
   
   def start(self):
      Timekeeper.last_updated = time.time()
      Timekeeper.frame_time = 0.0
   
   def update(self):
      now = time.time()
      Timekeeper.frame_time = now - Timekeeper.last_updated
      Timekeeper.last_updated = now
